﻿using Little.Soldier;
using Little.Soldier.SWIFT.Validation;
using Little.Soldier.SWIFT.Validation.Block2;
using System;
using System.ComponentModel;

namespace Little.Soldier.SWIFT
{
  [TypeConverter(typeof(ISwiftBlock2))]
  [ToolboxItem(false)]
  [DesignTimeVisible(false)]
  [Serializable]
  public abstract class SwiftBlock2 : SwiftValueBlock
  {
    private string _MessagePriority;
    private string _MessageType;

    public virtual string MessageType
    {
      get
      {
        return this._MessageType;
      }
      set
      {
        this._MessageType = value;
      }
    }

    public override string BlockName
    {
      get
      {
        return "2";
      }
    }

    public override int BlockNumber
    {
      get
      {
        return 2;
      }
    }

    public abstract bool IsInput { get; }

    public virtual string MessagePriority
    {
      get
      {
        return this._MessagePriority;
      }
      set
      {
        this._MessagePriority = value;
      }
    }

    public SwiftBlock2(SwiftMessage swiftMessage)
      : base(swiftMessage)
    {
    }

    public override void InitializeRules()
    {
      this.Rules.Add((IValidate) new Validate_MessageType(typeof (SwiftBlock2).GetProperty("MessageType"), (object) this));
    }
  }
}
